#include "Writter.h"
#include <fstream>
#include <iostream>

using namespace std;
Writter::Writter(void)
{
}


Writter::~Writter(void)
{
}

void Writter::writeToFile(char* path,DayAppCol* model)
{
	for(int i=0;i<5;i++)
	{
		string oPath;
		char buffer[255];
		oPath.append(path);
		oPath.append("\\");
		_itoa_s(i+1,buffer,10);
		oPath.append(buffer);
		oPath.append(".txt");
		ofstream outputFile(oPath);
		if (outputFile.is_open())
		{
			vector<string>* v = &model[i].dateEtCol;
			for (unsigned int j=0;j<v->size();j++)
			{
				outputFile<<(*v)[j]<<endl;
			}
			outputFile.close();
		}else cout << "Unable to open file";
	}

}